<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>H+ 后台主题UI框架 - 主页</title>

    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">

</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
    <div id="leftMenu"></div>
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div id="top">

        </div>
        <div class="row J_mainContent" id="content-main">

        </div>
    </div>
</div>
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.5"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="js/plugins/jquery.cookie.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>
<script src="js/hplus.min.js?v=4.0.0"></script>
<script src="js/plugins/toastr/toastr.min.js"></script>
<script src="js/plugins/validate/jquery.validate.min.js"></script>
<script src="js/plugins/validate/messages_zh.min.js"></script>
<script src="js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="js/ds-free-module.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="handler.js"></script>

<script>
    $(function () {
        DsModule.root = "/moqu-wx-app-web/";
        var token = $.cookie('token');
        if (token == null) {
            noLogin();
            return;
        }
        var name = $.cookie('name');
        var type = $.cookie('type');
        window.sysUser = {};
        window.sysUser.token = token;
        window.sysUser.name = name;
        window.sysUser.type = type;
        if (type == 0) {
            window.sysUser.typeTitle = "开发者";
        } else if (type == 1) {
            window.sysUser.typeTitle = "超级管理员";
        } else if (type == 2) {
            window.sysUser.typeTitle = "管理员";
        }
        //初始化全部菜单权限
        window.sysPermissisonsMap = {};
        window.sysPermissisonsIdMap = {};
        window.sysPermissisonsList = {};

        DsModule.toDefaultIndex = function (reload) {
            var obj = DsModule.getPath();
            if (!obj) {
                commonlayout(null, null, null, null, reload);
                return;
            }
            var m = new Module(obj.path);
            m.params = obj.params;
            var permission = window.sysPermissisonsMap[obj.path];
            if (permission != null) {
                if (permission.type == 0) {
                    for (; ;) {
                        permission = window.sysPermissisonsIdMap[permission.parentId];
                        if (permission.type == 1) {
                            break;
                        }
                    }
                }
            }
            var name = permission == null ? "未定义的菜单" : permission.name;
            var menuId = permission == null ? "noMenu" : permission.code;
            commonlayout(menuId, obj.path, name, m, reload);
        };

        ajaxPost({
            url: "sysPermission/findAll",
            success: function (data) {
                window.sysPermissisonsList = data.data;
                var allPermissionCode = [];
                for (var i = 0; i < data.data.length; i++) {
                    allPermissionCode.push("." + data.data[i].code);
                    window.sysPermissisonsMap[data.data[i].path] = data.data[i];
                    window.sysPermissisonsIdMap[data.data[i].id] = data.data[i];
                }
                writeStyle(allPermissionCode.join(",") + "{display:none}");
                ajaxPost({
                    url: "sysUser/findSysPermission",
                    success: function (data1) {
                        window.sysUser.sysPermission = data1.data;
                        DsModule.to();
                    }
                })
            }
        });
    });
</script>
</body>


</html>